<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE hrc PUBLIC "-//Cail Lomecb//DTD Colorer HRC take5//EN"
	"http://colorer.sf.net/2003/hrc.dtd">
<hrc
	version="take5"
	xmlns="http://colorer.sf.net/2003/hrc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://colorer.sf.net/2003/hrc http://colorer.sf.net/2003/hrc.xsd">

<type name="json">

	<annotation><documentation>
		json scheme
	</documentation><contributors><![CDATA[
		Aliaksei Chapyzhenka <alex.drom@gmail.com>
	]]></contributors></annotation>

	<import type="def"/>

	<scheme name="jsonComment">
	</scheme>
      
	<scheme name='jsonQuote'>
		<regexp match="/\\u[\dA-Fa-f]{4}/" region0="StringContent"/>
      	<regexp match="/\\x[\dA-Fa-f]{2}/" region0="StringContent"/>
      	<regexp match="/\\[\\bfnrtv]/"     region0="StringContent"/>
	</scheme>

	<scheme name="jsonMETA">
		<inherit scheme='jsonQuote'/>
		<regexp match="/\\[&quot;&apos;/]/" region0="StringContent"/>
	</scheme>

	<scheme name="String">
		<inherit scheme="jsonMETA"/>
	</scheme>

	<scheme name="RE">
		<inherit scheme="regexp:pcre.regexp">
			<virtual scheme="regexp:string" subst-scheme="jsonMETA"/>
			<virtual scheme="regexp:pcre.regexp" subst-scheme="RE"/>        
		</inherit>
	</scheme>


    <scheme name="json.float">
        <regexp match="/(-)? \B    (\.)\d+ (e[\-+]?\d+)? \b/ix" region0="NumberFloat" region1="def:Symbol" region2="def:Symbol" region3="NumberSuffix"/>
        <regexp match="/(-)? \b \d+(\.)\d* (e[\-+]?\d+)? \b/ix" region0="NumberFloat" region1="def:Symbol" region2="def:Symbol" region3="NumberSuffix"/>
        <regexp match="/(-)? \b \d+        (e[\-+]?\d+)  \b/ix" region0="NumberFloat" region1="def:Symbol"                      region2="NumberSuffix"/>
    </scheme>
    <scheme name="json.decimal">
        <regexp match="/(-)?\b\d+ (ul{0,2}|l{1,2}u?|i64|i128)?\b/ix" region0="NumberDec" region1="def:Symbol" region2="NumberSuffix"/>
    </scheme>
<!-- JSON допускает ТОЛЬКО десятичные и float числа -->
    <scheme name="json.numbers">
      <inherit scheme="json.float"/>
      <inherit scheme="json.decimal"/>
    </scheme>

<!-- JSON !!!НЕ ДОПУСКАЕТ!!! использование одинарных кавычек! -->
	<scheme name="jsonString">
		<block start="/(&quot;)/" end="/(&quot;)/"
			scheme="String" region="String"
			region00='StringEdge' region01='PairStart'
			region10='StringEdge' region11='PairEnd'
		/>
	</scheme>
	<scheme name="booleans">
		<keywords region="def:BooleanConstant">
			<word name="false"/>
			<word name="true"/>
		</keywords>
	</scheme>
	<scheme name="null">
		<keywords region="def:Keyword">
			<word name="null"/>
		</keywords>
	</scheme>
      
	<scheme name="json">
		<block start="/\/\//" end="/\M(&lt;\/scr|$)/i" scheme="jsonComment" region="Comment"/>
		<block start="/\/\*/" end="/\*\//"             scheme="jsonComment" region="Comment" region00="PairStart" region10="PairEnd"/>
		<inherit scheme="PairedBrackets">
			<virtual scheme="PairedBrackets" subst-scheme="json"/>
		</inherit>
		<inherit scheme="json.numbers"/>
		<inherit scheme="jsonString"/>
		<inherit scheme="booleans"/>
		<inherit scheme="null"/>
		<keywords region="def:Symbol">
			<symb name=","/>
		</keywords>
		<keywords region="def:SymbolStrong">
			<symb name=":"/>
		</keywords>
		<block scheme="RE" region="String">
			<start region1="Symbol" region2="StringEdge" region3="PairStart">
			<![CDATA[
				/
				( [\=\!]\~ | && | \|\| |
				[^<\]\}\)\+\-\w\s\/\;] |
				\bif | ~ | ^)
				\s* ((\/))\M[^\/\*>] /x
			]]>
			</start>
			<end region0="StringEdge" region1="PairEnd" region2="regexp:SpecArea">
				<![CDATA[
				/(\y2([cmiogxes]*))/x
				]]>
			</end>
		</block>
		<regexp match="/[^\s]/" region="def:Error" priority="low" />
	</scheme>

</type>
</hrc>
<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is the Colorer Library.
   -
   - The Initial Developer of the Original Code is
   - Aliaksei Chapyzhenka <alex.drom@gmail.com>.
   - Portions created by the Initial Developer are Copyright (C) 1999-2005
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the LGPL or the GPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->
